<template>
    <h2>Demo</h2>
    <h2>{{count}}</h2>
    <button @click="AddCount">Add</button>

</template>

<script setup lang="ts">
//狗子函数类似于文档就绪函数
import {ref,onMounted}from 'vue'

//创建响应式数据
const count=ref(1232100);
function AddCount(){
    count.value++;
}
//声明生命周期函数沟
onMounted(()=>{
    console.log("你在加载我")
})

</script>

<!-- <script>
export default{
    data(){
        return{
            count:200
        }
    },
    methods: {
        AddCount(){
        this.count++
        }
    }
}
</script> -->